package com.biz.primus.ms.commodity.trans;

import com.biz.primus.base.vo.commodity.SaleStatus;
import com.biz.primus.commodity.vo.backend.VendorProductListItemVo;
import com.biz.primus.ms.commodity.dao.po.ProductAudit;
import com.google.common.base.Function;
import javax.annotation.Nullable;


/**
 * @author 江南
 * @usage
 * @reviewer
 * @since 2017/2/22
 */
public class ProductAudit2VendorProductListItemVo implements Function<ProductAudit,VendorProductListItemVo> {

    @Nullable
    @Override
    public VendorProductListItemVo apply(@Nullable ProductAudit input) {
        VendorProductListItemVo respVo = new VendorProductListItemVo();
        respVo.setId(String.valueOf(input.getProductId()));
        respVo.setAuditStatus(input.getAuditStatus().getDescription());
        respVo.setLastUpdateTime(input.getUpdateTimestamp());
        respVo.setProductCode(input.getProductCode());
        respVo.setProductName(input.getName());
        respVo.setSaleStatus(SaleStatus.OFF_SALE.getDescription());
        respVo.setLogo(input.getLogo());
        respVo.setProductAuditId(String.valueOf(input.getId()));
        return respVo;
    }

}
